OpenBuildings GenerativeComponents Help

ExcelRange.ReadValue

In the following example, we use a spreadsheet filled with point coordinate values to create a list of points. Start by making a simple spreadsheet where each column represents an X, Y, and Z value. Every row then represents a single point’s X,Y,Z value.

In the spreadsheet below, the first point has the coordinates (1,5,6), the second (2,5,1), and so on. Save the spreadsheet so that it can be easily accessible later.

The next step (in OpenBuildings™ GenerativeComponents) is to establish a link with the spreadsheet you just created. Using the ExcelRange.ReadValue node, use the f(x) button to navigate to your spreadsheet, and then specify the spreadsheet to query in the SheetName property. For the RangeAddress parameter, define a range from the first cell value to the last, beginning in the upper left-hand corner of your spreadsheet to the lowest cell on the right.

Once the ExcelRange node has been created, the values contained within it can be used to create a list of points. The easiest node to achieve this is with the Point.ByCoordinateList node. After specifying a host coordinate system, the contents of the ExcelRange must be extracted for the XYZTranslation input property using the dot operator (.). In order to access this information, input the name of the ExcelRange into the XYZTranslation field. In this case the name is excelRange01. Press the period key on your keyboard (<.>) to open the list of properties associated with the ExcelRange. Scroll down to the Value property or press V on your keyboard to jump directly to it (If it is not there, just type .). The input should look like the code below:

XYZTranslation = excelRange01.Value

In the model view, a B-spline curve with an order of three is drawn through the points.

At any point in the future, the spreadsheet can be edited and GenerativeComponents will read the new values before updating the model view. After the spreadsheet is updated and saved, simply click (Update Model ) or replay the transaction containing the ExcelRange node.